import React from 'react';
import { View, StyleSheet, Text, Image } from 'react-native';
import {windowWidth} from "../../utils/config";

const emptyIcon = require('../../assets/images/icon_empty.png');

export default function({ style, text = '暂无数据' }) {
    return (
        <View style={[styles.wrapper, style]}>
            <Image source={emptyIcon} style={styles.emptyIcon}/>
            <Text style={styles.emptyText}>{text}</Text>
        </View>
    );
}

const styles = StyleSheet.create({
    wrapper: {
        justifyContent: 'center',
        alignItems: 'center',
        paddingTop: 100,
    },
    emptyText: {
        color: '#C0BFC5',
        fontSize: 13.33,
    },
    emptyIcon: {
        width: parseInt(String(windowWidth * 0.5)),
        height: parseInt(String(windowWidth * 0.5 * 360 / 594)),
    }
});
